Page({
  data: {
    id: 0,
    point: "",
    building: "",
    room: "",
    name: "",
    gender: 1,
    mobile: "",
    idcardFrontUrl: '',
    idcardBackUrl: '',
    status: 1
  },
  onLoad(option) {
    let { id } = option
    this.setData({
      id
    })
  },
  onShow() {
    this.getRoomInfo()
  },
  async getRoomInfo() {
    let res = await wx.http.get('/room/' + this.data.id)
    this.setData({
      point: res.point,
      building: res.building,
      room: res.room,
      name: res.name,
      gender: res.gender,
      mobile: res.mobile,
      idcardFrontUrl: res.idcardFrontUrl,
      idcardBackUrl: res.idcardBackUrl,
      status: res.status
    })
  },
  editHouse() {
    wx.navigateTo({
      url: '/house_pkg/pages/form/index?id=' + this.data.id,
    })
  },
})
